import 'package:flutter/material.dart';
import 'package:my_audio_recorder_example/Ext/StringExt.dart';

class TitleBarWidget extends StatefulWidget {
  const TitleBarWidget(
      {super.key, required this.title, this.color = "#000000"});

  final String title;
  final String color;

  @override
  State<TitleBarWidget> createState() => _TitleBarWidget();
}

class _TitleBarWidget extends State<TitleBarWidget> {

  @override
  Widget build(BuildContext context) {
    return Column(children: [
      AppBar(
        iconTheme: IconThemeData(color: widget.color.toColor()),
        backgroundColor: '#459845'.toColor(),
        title: Text(
          widget.title,
          style: TextStyle(color: widget.color.toColor()),
        ),
      ),
    ]);
  }
}
